﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ThePingMasterConfiguration.Services;
using ThePingMasterConfiguration.ViewModels;

namespace ThePingMasterConfiguration.Commands
{
    class CommandFactory : ICommandFactory
    {
        public SaveCommand GetSaveCommand(ConfigurationModel model)
        {
            return new SaveCommand(model, new MessageService());
        }

        public QuitCommand GetQuitCommand()
        {
            return new QuitCommand();
        }

        public BrowseSuccessCommand GetBrowseSuccessCommand(ConfigurationModel model)
        {
            return new BrowseSuccessCommand(new OpenFileDialogService(), model);
        }

        public BrowseFailureCommand GetBrowseFailureCommand(ConfigurationModel model)
        {
            return new BrowseFailureCommand(new OpenFileDialogService(), model);
        }

        public AboutCommand GetAboutCommand()
        {
            return new AboutCommand(new AboutService());
        }

        public RunProcessCommand GetRunProcessCommand(string processPath)
        {
            return new RunProcessCommand(processPath);
        }

        public RemoveAddressCommand GetRemoveAddressCommand(ConfigurationModel configurationModel)
        {
            return new RemoveAddressCommand(configurationModel);
        }

        public AddAddressCommand GetAddAddressCommand(ConfigurationModel configurationModel)
        {
            return new AddAddressCommand(configurationModel, new EnterAddressService(this));
        }

        public MessageCommand GetDuplicateAddressCommand(string duplicateAddressMessage)
        {
            return new MessageCommand(duplicateAddressMessage, new MessageService());
        }
    }
}
